package Exercise;

import java.util.Random;

public class Test2LotteryDraw1 {
    public static boolean judge(int[] lootertDraw, int reword) {
        for (int i : lootertDraw) {
            if (i == reword)
                return false;
        }
        return true;
    }

    public static void main(String[] args) {
        Random r = new Random();
        int[] rewardNum = {88, 100, 588, 888, 1000}, lootertDarw = new int[5];
        int index;
        for (int i = 0; i < rewardNum.length; ) {
            index = r.nextInt(5);
            if (judge(lootertDarw, rewardNum[index])) {
                lootertDarw[i] = rewardNum[index];
                i++;
            }
        }
        for (int i : lootertDarw) {
            System.out.print(i + " ");
        }
    }
}
